define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'jizhan.taihe_contents/index',
        add_url: 'jizhan.taihe_contents/add',
        edit_url: 'jizhan.taihe_contents/edit',
        delete_url: 'jizhan.taihe_contents/delete',
        export_url: 'jizhan.taihe_contents/export',
        modify_url: 'jizhan.taihe_contents/modify',
        activity_product_url: 'jizhan.taihe_contents/index',
    };
    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: "checkbox"},
                    {field: 'id', width: 30, title: 'ID', search: 'no'},
                    {field: 'type', minWidth: 150, title: '类型' , selectList:typeList},
                    {field: 'categorys_id', minWidth: 100, title: '分类名称', selectList:categorysList},
                    {field: 'title', minWidth: 100, title: '标题'},
                    {field: 'url', minWidth: 100, title: '跳转链接', search: 'no'},
                    {field: 'page', minWidth: 100, title: '跳转页面', search: 'no'},
                    {field: 'remark', minWidth: 100, title: '备注说明', search: 'no'},
                    {field: 'user_info', minWidth: 120, title: '用户信息', search: 'no'},
                    {field: 'publish_time', minWidth: 120, title: '发布时间', search: 'no'},
                    {field: 'is_read', minWidth: 120, title: '是否已读', selectList:readList},
                    {field: 'create_time', minWidth: 120, title: '创建时间', search: 'no'},
                    {width: 250, title: '操作', templet: ea.table.tool,
                        operat: [
                            [{
                                text: '编辑',
                                url: init.edit_url,
                                method: 'open',
                                auth: 'edit',
                                class: 'layui-btn layui-btn-xs layui-btn-success',
                                extend: 'data-full="true"',
                            }],
                            'delete']
                    }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});